<?php

include "config.php";

$sql = mysql_query("Select * from img");

while ($row = mysql_fetch_array($sql)){

echo "<img class = 'teste' src = imagens/".$row['nome'].".".$row['formato']." onClick = 't(this);'>";


}

?>